% araim - altered from Strumpen algorithm

ProcessWork($A[M][N]$ : matrix, $lb_i$ : block index, $ub_i$ : block index, $lb_j$ : block index, $ub_j$ : block index, $\delta$, $converged$)
\begin{algorithmic}
\FOR{$i=lb_i$ to $ub_i$}
  \STATE $S[i] \gets A[i]^T A[i]$
\ENDFOR
\FOR{$j=lb_j$ to $ub_j$}
  \STATE $S[j] \gets A[j]^T A[j]$
\ENDFOR
\FOR{$i=lb_i$ to $ub_i$}
  \FOR{$j=lb_j$ to $ub_j$}
    \IF{$i < j$}
      \STATE $g \gets A[i]^T A[j]$
      \IF{$|g|> \delta$}
        \STATE $converged \gets false$
      \ENDIF
      \IF{$|g| > \epsilon$}
        \STATE $c, s \gets jacobi(S[i], S[j], g)$
        \FOR{$k = 1$ to $N$}
          \STATE $A[i][k], A[j][k] \gets cA[i][k] - sA[j][k], sA[i][k] + cA[j][k]$
        \ENDFOR
      \ENDIF
    \ENDIF
  \ENDFOR
\ENDFOR
\end{algorithmic}

